/*
    Android UIML

	Copyright (C) 2010  Bram Goffings (bramgoffings@gmail.com)

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public License
	as published by the Free Software Foundation; either version 2.1
	of	the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

package uiml.android.elements;

import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;

public class Meta extends UimlElement implements IUimlAttribute{
	
	// TODO comment
	private String name = null;
	private String content = null;
	
	// TODO comment
	public final String NAME 	= "name";
	public final String CONTENT = "content";
	public static String IAM = "meta";
	
	/**
	 * 
	 * @param node
	 */
	public Meta(Element node) {
		super(node);
		process();
	}

	/**
	 * 
	 */
	public void process() {
		processAttributes();
		super.process();
	}

	/**
	 * 
	 */
	@Override
	public void processAttributes() {
		NamedNodeMap attributes = node.getAttributes();
		
		if(attributes != null) {
			if(attributes.getNamedItem(NAME) != null)
				name = attributes.getNamedItem(NAME).getNodeValue();
			if(attributes.getNamedItem(CONTENT) != null)
				content = attributes.getNamedItem(CONTENT).getNodeValue();
		}
	}

	/**
	 * 
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * 
	 * @return
	 */
	public String getName() {
		return name;
	}

	/**
	 * 
	 * @param content
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * 
	 * @return
	 */
	public String getContent() {
		return content;
	}

}
